#!/usr/bin/env python3
# -*- coding=utf-8 -*-
# 题目：从键盘输入一些字符，
# 逐个把它们写到磁盘文件上，
# 直到输入一个 # 为止。


def f1():
    s = ""
    with open("ceshi.txt", "w+") as f:
        while "#" not in s:
            s = input("input some words: ")
            f.write(s)
        else:
            for x in s:
                if x != "#":
                    f.write(x)
                else:
                    break


f = f1
if __name__ == "__main__":
    f()
